package com.hcg.initproject.controller;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 加入 @ComponentScan注解后 提供扫包范围，只要在同一个包下的类启动均可访问成功
 * 并且 只提供 @RestController 一个就可以
 */
@RestController
@EnableAutoConfiguration
//@ComponentScan("com.hcg.initproject.controller")
@ComponentScan({"com.hcg.initproject.controller","com.hcg.initproject.controllersame"})
public class Initproject03 {

    public static void main(String[] args) {
        SpringApplication.run(Initproject03.class, args);
    }

    @RequestMapping("/init")
    public String init(){
        return "init project";
    }

}

